package com.study.结构型模式.代理模式.动态代理;

public class Client {

    public static void main(String[] args) {

        ProxyFactory proxyFactory = new ProxyFactory(new TeacherDao());
        ITeacherDao proxyInstance = (ITeacherDao) proxyFactory.getProxyInstance();
        proxyInstance.teach();


        //动态代理中 代理类与接口没有依赖关系，因此当添加新方法时，代理类不需要改动代码

        ClassLoader classLoader = Object.class.getClassLoader();
        System.out.println("classLoader = " + classLoader);

    }
}
